package com.userfactssample.client.client.framework;

import com.smartgwt.mobile.client.widgets.BaseButton.ButtonType;
import com.smartgwt.mobile.client.widgets.Button;
import com.smartgwt.mobile.client.widgets.events.ClickEvent;
import com.smartgwt.mobile.client.widgets.events.ClickHandler;
import com.userfactssample.client.client.framework.event.UMActionEvent;
import com.userfactssample.client.client.framework.handler.UMActionHandler;

public class UMButton extends UMComponent<Button> {

	public UMButton() {
		super(new Button());
	}

	@Override
	protected void initialiseComponent() {

	}
	
	public void setButtonType(ButtonType roundedRectangle) {
		getComponent().setButtonType(roundedRectangle);
	}

	public void addClickHandler(final UMActionHandler clickHandler) {
		getComponent().addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				clickHandler.onAction(new UMActionEvent(getUMComponent()));
			}
		});
	}
}
